﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PhotoBook.Services
{
    public class OpenStoredTransformation : PhotoBook.Model.Services.IOpenStored 
    {
        public PhotoBook.Model.Entities.FotoTransformation OpenTransformation(string file)
        {
            return OpenTransformation(System.IO.File.OpenRead(file));
        }



        public PhotoBook.Model.Entities.FotoTransformation OpenTransformation(System.IO.FileStream stream)
        {
            System.Runtime.Serialization.Formatters.Binary.BinaryFormatter binaryReader = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
            Object objeto = binaryReader.Deserialize(stream);
            stream.Close();
            return (PhotoBook.Model.Entities.FotoTransformation)objeto;
        }

    }
}
